################################################################
## Replication File  ##
## Title: Personal Experience and Public Opinion: A Theory and Test of Conditional Policy Feedback
## Authors: Amy E. Lerman and Katherine T. McCabe
## Journal: The Journal of Politics
## Analysis Data File: joprep1.dta  ##
########################################################

## Load Packages and Read Data
library(foreign)
library(sandwich)

cces <- read.dta("joprep1.dta")

#################################
## Figure 1
#################################

## Conducted Differences in Means by Years
byrs <- paste("byr", seq(36, 94, 2), seq(37, 95, 2), sep = "")
yrs <- seq(1936, 1994, 2)
yrs2 <- seq(1937, 1995, 2)
table(cces$privhealthins2only)
mpub <- rep(NA, length(yrs))
mpriv <- rep(NA, length(yrs))
for(i in 1:length(yrs2)){
  mpub[i] <-  weighted.mean(cces$pubhealthins3[cces$birthyr == yrs[i] | 
                                                 cces$birthyr == yrs2[i]], 
                            cces$V103[cces$birthyr == yrs[i] | 
                                        cces$birthyr == yrs2[i]], na.rm = T)
  mpriv[i] <- weighted.mean(cces$privhealthins2only[cces$birthyr == yrs[i] | 
                                                      cces$birthyr == yrs2[i]], 
                            cces$V103[cces$birthyr == yrs[i] | 
                                        cces$birthyr == yrs2[i]], na.rm = T)
}
names(mpub) <- paste(yrs, "-", yrs2, sep = "")
names(mpriv) <- paste(yrs, "-", yrs2, sep = "")


## Plot Results
pdf("jopfig1.pdf",  width=7,height=5)
par(mar = c(7, 4, 4, 2))
plot(1:length(mpub), mpub,
     pch = 16, type = "b",
     ylim = c(0, 1),
     main= "Percent of Respondents with Private vs. Public Insurance by Birth Year",
     xaxt = "n", yaxt = "n",
     xlab = "Birth Year",
     ylab = "Percent of Respondents",
     cex.main = .85, cex.lab = .8, cex.axis = .8)
axis(2, seq(0, .9, .3), seq(0, 90, 30), las = 2, cex.axis = .75, tick = FALSE)
abline(h = seq(0, .9, .3), lty = 20, col = "gray")
abline(v = seq(1,length(mpub),1), lty = 20, col = "gray")
axis(1, 1:length(mpub), labels = names(mpub), cex.axis = .5, tick = FALSE, las = 2 )
points(1:length(mpub), mpub,
       pch = 16, type = "b")
points(1:length(mpub), mpriv, pch = 17, type = "b")
legend(22, .85, legend = c("Private Insurance Only", "Public Insurance"), pch = c(17, 16), cex = .75, box.col = "white")
dev.off()


############################################################
## Figure 2 (See Stata Code for difference in means tests)
############################################################

### Covariate balance
ymo <- c(0.12,  0.28, 0.15,
         -0.00, 0.09, 0.01,-0.01,
         0.00,0.02, 0.01,-0.01,
         0.01,-0.01,-0.00,0.00, 0.01, 0.02,-0.05,
         0.00,  0.01, 0.02,0.02,-0.02, 0.01,  0.01)
ymol <- c("Political Knowledge","Education (1 to 6)",
          "Family Income (1 to 16) ", "Family Income Missing",
          "Full/Part-time Employed","Industry- Healthcare or Social", 
          "Industry- Finance or Insurance","Occupation: Healthcare Support",
          "Black","Hispanic","Married",
          "Republican","Democrat","Ideological Conservatism",
          "Conservative (vs. Liberal/Moderate)",
          "Importance of Religion",
          "Born Again","Follows News about Politics (1 to 4)",
          "Registered to Vote", "Voted in 2008",
          "Labor", "Mobility","Child under 18","Homeowner","Public Employee")
# P-value
ymopval <- c(0.0065,  0.0000, 0.0990, 0.9704, 0.0000,
             0.2749,0.2479, 0.8050, 0.0193,
             0.3606,0.2848, 0.6600, 0.4105,0.9479, 0.7852,0.6785,
             0.0845, 0.0038,0.4579,0.1406,0.1273,0.3290,0.0001,0.0410,0.5376)

pdf("jopfig2.pdf", width = 7, height = 5)
par(mar = c(4, 11, 4, 2))
plot(ymo, 1:length(ymo),
     xlim = c(-.1, .35),
     ylab = "", xlab = "Difference in Mean",
      main = "Age Balance \n Younger (1948-49) - Older (1946-47)",
     pch = 16, cex.main = .85, cex.lab = .8, cex.axis = .6,
     xaxt = "n", yaxt = "n")
abline(h = 1:length(ymo), lty = 20, col = "gray")
axis(2, 1:(length(ymo)), ymol, cex.axis = .6, tick = F, las = 2)	
abline(v=seq(-.1, .3, .1), lty = 20, col = "light gray")
abline(v=0)
points(ymo, 1:length(ymo), pch = 16)
axis(1, seq(-.1, .3, .1), cex.axis = .75, tick = F)
text(ymo + .03, 1:length(ymo), paste("p=", round(ymopval, digits = 3), sep=""), cex = .55)
dev.off()



#################################
## Figure 3 (See Stata Code for regression code)
##################################

pdf("jopfig3.pdf", width = 7, height = 5)	
plot(1:5, c(0.385, 0.376, 0.366, 0.356, 0.346),
     pch = 15, type = "b", main = "Effect of General Health X Public vs. Private Insurance on Medicare Views \n p < 0.10",
     cex.main = .8, ylab = "Estimated Support for Opposing the Reduction of Medicare Spending",
     cex.lab = .7, xaxt = "n", xlab = "",  yaxt = "n",xlim = c(0, 5.5),
     ylim = c(.2, .5))
abline(h = seq(.2, .5, .05), lty = 20, col = "gray")

polygon(c(1:5, rev(1:5), 1), c(c(0.353, 0.356, 0.347,0.325, 0.299),
                               rev(c(0.418, 0.395, 0.385, 0.387, 0.394)), 
                               .353), col = "grey70")
polygon(c(1:5, rev(1:5), 1), c(c(0.369, 0.395, 0.412, 0.416, 0.415),
                               rev(c(0.438, 0.438, 0.448, 0.471, 0.499)), 
                               .369), col = "grey40")
points(1:5,  c(0.403, 0.417, 0.430, 0.444, 0.457), pch = 16, type = "b")	
points(1:5, c(0.385, 0.376, 0.366, 0.356, 0.346), pch = 15, type = "b")	
axis(2, seq(.2, .5, .05), seq(.2, .5, .05), las = 1, tick = F, cex.axis = .7)
text(c(1, 5), .22, c("Excellent \n Health", "Poor \n Health"), cex = .8)	
text(c(.65,.68), c(.43, .33), c("Has Public \n Insurance", "Has Private Insurance \n Only"), cex = .7)	
dev.off()


#################################################
## Figure 4 (See Stata Code for regression code)
###################################################

## Support ACA
aca.all.coef <- -0.0459  
aca.all.se <- 0.0228
aca.all.hb <-  -0.0459 + qnorm(.975)*0.0228
aca.all.lb <-  -0.0459 - qnorm(.975)*0.0228

## rep
aca.rep.coef <- -0.0388
aca.rep.se <- .0351 
aca.rep.hb <- -0.0388 + qnorm(.975)*.0351
aca.rep.lb <- -0.0388 - qnorm(.975)*.0351

## dem
aca.dem.coef <- .0138   
aca.dem.se <- .0245 
aca.dem.hb <- .0138 + qnorm(.975)*.0245
aca.dem.lb <- .0138 - qnorm(.975)*.0245

## ind
aca.ind.coef <-  -.244   
aca.ind.se <- .134
aca.ind.hb <-  -.244 + qnorm(.975)*.134 
aca.ind.lb <- -.244 - qnorm(.975)*.134

## Don't cut medicare

dcm.all.coef <- -.0836  
dcm.all.se <- .0269
dcm.all.hb <- -.0836 + qnorm(.975)*.0269 
dcm.all.lb <- -.0836 - qnorm(.975)*.0269 


dcm.rep.coef <- -.0726
dcm.rep.se <- .0299
dcm.rep.hb <- -.0726 + qnorm(.975)*.0299
dcm.rep.lb <- -.0726 - qnorm(.975)*.0299

dcm.dem.coef <- -.0296
dcm.dem.se <- .0431
dcm.dem.hb <- -.0296 + qnorm(.975)*.0431
dcm.dem.lb <- -.0296 - qnorm(.975)*.0431

dcm.ind.coef <- -.158 
dcm.ind.se <- .127
dcm.ind.hb <- -.158  + qnorm(.975)*.127
dcm.ind.lb <- -.158  - qnorm(.975)*.127

pdf("jopfig4.pdf",  width=7,height=5)
par(mar = c(3, 6, 4, 2))
plot(1:8, 
     -1*c(aca.all.coef, aca.rep.coef, aca.dem.coef, aca.ind.coef, dcm.all.coef, dcm.rep.coef, dcm.dem.coef, dcm.ind.coef), 
     ylim= c(-.4, .65), xlim=c(.9, 8.2),
     xlab = "", xaxt = "n", yaxt = "n", 
     main = "Effect of Insurance Type on Support for ACA and Medicare \n Public vs. Private Insurance", 
     cex.main = .8, cex.lab = .75, cex.axis = .8, 
     ylab = "Estimated Percentage Difference in Support \n Public vs. Private Insurance", pch = 16)


text(2.5, .5, "Support for the ACA", cex = .7)
text(6.5, .5, "Don't Cut Medicare", cex = .7)
abline(v=4.5, col = "gray", lty = 20)
abline(h = seq(-.4, .6, .20), lty = 20, col = "gray")
abline(h=0, col = "black")
lines(c(1,1), -1*c(aca.all.lb, aca.all.hb))
lines(c(2,2), -1*c(aca.rep.lb, aca.rep.hb))
lines(c(3,3), -1*c(aca.dem.lb, aca.dem.hb))
lines(c(4,4), -1*c(aca.ind.lb, aca.ind.hb))
lines(c(5,5), -1*c(dcm.all.lb, dcm.all.hb))
lines(c(6,6), -1*c(dcm.rep.lb, dcm.rep.hb))
lines(c(7,7), -1*c(dcm.dem.lb, dcm.dem.hb))
lines(c(8,8), -1*c(dcm.ind.lb, dcm.ind.hb))
points(1:8, 
       -1*c(aca.all.coef, aca.rep.coef, aca.dem.coef, aca.ind.coef, dcm.all.coef, dcm.rep.coef, dcm.dem.coef, dcm.ind.coef), pch = 16)
text(c(1, 2, 3, 4, 5, 6, 7, 8), rep(-.38, 8), c("All", "Republicans", "Democrats", "Independents","All", "Republicans", "Democrats", "Independents"), cex = .6)
axis(2, at= seq(-.4, .6, .2), labels = c("-40%", "-20%", "0", "20%", "40%", "60%"), las = 2, cex.axis = .55, tick = FALSE)
text(c(1.2, 2.2, 3.2, 4.2, 5.2, 6.2, 7.2, 8.2), -1*c(aca.all.coef , aca.rep.coef, aca.dem.coef, aca.ind.coef, dcm.all.coef, dcm.rep.coef, dcm.dem.coef, dcm.ind.coef), c("5%", "4%", "-1%", "24%", "8%", "7%", "3%", "16%"), cex=.6)

dev.off()


#################################################
## Figure 5 (See Stata Code for regression code)
###################################################

pvp.h.s <- -.01
pvp.h.sse <-.0204

pvp.l.s <- -.14
pvp.l.sse <-.0639


pvp.h.d <- -.06
pvp.h.dse <-.0263

pvp.l.d <- -.13
pvp.l.dse <-.0677


pdf("jopfig5.pdf", width = 7, height = 5)
par(mar = c(2, 6, 4, 2))
plot(1:4, -1*c(pvp.h.s,
               pvp.l.s,
               pvp.h.d,
               pvp.l.d),
    ylim = c(-.2, .4),
     cex.main = .8, cex.lab = .75, cex.axis = .7,
     xaxt = "n", yaxt = "n", xlim =c(.8, 4.2), pch = 16,
     ylab = "Estimated Percentage Difference in Support \n Private vs. Public Insurance Coefficients",
     main = "Support for ACA and Medicare Among High and Low Knowledge Respondents \n Private vs. Public Insurance Coefficients", xlab = "")

abline(h = seq(-.4, .4, .2), lty = 20, col = "gray")
abline(h=0, col = "black")
abline(v=2.5)

lines(c(1,1), -1*c((pvp.h.s - 1.96*pvp.h.sse),(pvp.h.s + 1.96*pvp.h.sse) ))
lines(c(2,2), -1*c((pvp.l.s - 1.96*pvp.l.sse),(pvp.l.s + 1.96*pvp.l.sse) ))
lines(c(3,3),-1* c((pvp.h.d - 1.96*pvp.h.dse),(pvp.h.d + 1.96*pvp.h.dse) ))
lines(c(4,4), -1*c((pvp.l.d - 1.96*pvp.l.dse),(pvp.l.d + 1.96*pvp.l.dse) ))
axis(2, seq(-.2, .6, .2), c("-20%", "0", "20%", "40%", "60%"), las=2, tick = F, cex.axis = .6)

text(1.1:4.1, -1*c(pvp.h.s,
                   pvp.l.s,
                   pvp.h.d,
                   pvp.l.d), paste(round(c(pvp.h.s,
                                           pvp.l.s,
                                           pvp.h.d,
                                           pvp.l.d), digits = 2)*100*-1, "%", sep = ""), cex = .6)
text(1:4, rep(.29, 4), rep(c("High Knowledge", "Low Knowledge"), 2), cex = .6)
text(c(1.5, 3.5), c(.35, .35), c("Support ACA", "Don't Cut Medicare"), cex = .7)
dev.off()





#################################
## Figure 6
##################################

## Support ACA
m.4243 <- lm(suppafford ~ byr4243 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
               male + married + labor + mobility + homeowner 
             + religimp + employed +votereg + vote08 + black + hispanic2
             + military + educ + fincome + newsint + publicemp + bornagain, data = cces)

m.4445 <- lm(suppafford ~ byr4445 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
               male + married + labor + mobility + homeowner 
             + religimp + employed +votereg + vote08 + black + hispanic2
             + military + educ + fincome + newsint + publicemp + bornagain, data = cces)

m.4647 <- lm(suppafford ~ byr4647 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
               male + married + labor + mobility + homeowner 
             + religimp + employed +votereg + vote08 + black + hispanic2
             
             + military + educ + fincome + newsint + publicemp + bornagain, data = cces)
m.4849 <- lm(suppafford ~ byr4849 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
               male + married + labor + mobility + homeowner 
             + religimp + employed +votereg + vote08 + black + hispanic2
             + military + educ + fincome + newsint + publicemp + bornagain, data = cces)
m.5051 <- lm(suppafford ~ byr5051 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
               male + married + labor + mobility + homeowner 
             + religimp + employed +votereg + vote08 + black + hispanic2
             + military + educ + fincome + newsint + publicemp + bornagain, data = cces)

se.4243 <- sqrt(diag(vcovHC(m.4243)))
se.4445 <- sqrt(diag(vcovHC(m.4445)))
se.4647 <- sqrt(diag(vcovHC(m.4647)))
se.4849 <- sqrt(diag(vcovHC(m.4849)))
se.5051 <- sqrt(diag(vcovHC(m.5051)))

## Don't Cut Medicare
dm.4243 <- lm(dontcutmedicare ~ byr4243 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
                male + married + labor + mobility + homeowner 
              + religimp + employed +votereg + vote08 + black + hispanic2
              + military + educ + fincome + newsint + publicemp + bornagain, data = cces)
dm.4445 <- lm(dontcutmedicare ~ byr4445 + rep + ind + con  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
                male + married + labor + mobility + homeowner 
              + religimp + employed +votereg + vote08 + black + hispanic2
              + military + educ + fincome + newsint + publicemp + bornagain, data = cces)

dm.4647 <- lm(dontcutmedicare ~ byr4647 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
                male + married + labor + mobility + homeowner 
              + religimp + employed +votereg + vote08 + black + hispanic2
              
              + military + educ + fincome + newsint + publicemp + bornagain, data = cces)

dm.4849 <- lm(dontcutmedicare ~ byr4849 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
                male + married + labor + mobility + homeowner 
              + religimp + employed +votereg + vote08 + black + hispanic2
              + military + educ + fincome + newsint + publicemp + bornagain, data = cces)

dm.5051 <- lm(dontcutmedicare ~ byr5051 + rep + ind + con + mod  + ideostrength  + hcsocial + fininsur  + healthcaresupport + child18 +
                male + married + labor + mobility + homeowner 
              + religimp + employed +votereg + vote08 + black + hispanic2
              + military + educ + fincome + newsint + publicemp + bornagain, data = cces)


dse.4243 <- sqrt(diag(vcovHC(dm.4243)))
dse.4445 <- sqrt(diag(vcovHC(dm.4445)))
dse.4647 <- sqrt(diag(vcovHC(dm.4647)))
dse.4849 <- sqrt(diag(vcovHC(dm.4849)))
dse.5051 <- sqrt(diag(vcovHC(dm.5051)))



pdf("jopfig6.pdf",  width=7,height=5)
par(mar = c(2, 4, 4, 2))
plot(1:5, c(coef(m.4243)[2], coef(m.4445)[2],coef( m.4647)[2], coef(m.4849)[2],coef( m.5051)[2]),
      ylim=c(-.1,.1), cex.main = .8, pch =16,
     cex.lab = .75, cex.axis=.75, yaxt="n", xaxt="n", ylab = "Age Coefficient", xlab = "",
     main = "Reduced Form Effects of Age on Support for the ACA",xlim = c(.5, 5.5))
abline(h=seq(-.1, .1, .05), lty=20, col= "gray")
abline(h=0, col = "black")


lines(c(1,1), c((coef(m.4243)[2] - 1.96*se.4243[2]), (coef(m.4243)[2] + 1.96*se.4243[2])))
lines(c(2,2), c((coef(m.4445)[2] - 1.96*se.4445[2]), (coef(m.4445)[2] + 1.96*se.4445[2])))
lines(c(3,3), c((coef(m.4647)[2] - 1.96*se.4647[2]), (coef(m.4647)[2] + 1.96*se.4647[2])))
lines(c(4,4), c((coef(m.4849)[2] - 1.96*se.4849[2]), (coef(m.4849)[2] + 1.96*se.4849[2])))
lines(c(5,5), c((coef(m.5051)[2] - 1.96*se.5051[2]), (coef(m.5051)[2] + 1.96*se.5051[2])))

lines(c(1.2,1.2), c((coef(dm.4243)[2] - 1.96*dse.4243[2]), (coef(dm.4243)[2] + 1.96*dse.4243[2])))
lines(c(2.2,2.2), c((coef(dm.4445)[2] - 1.96*dse.4445[2]), (coef(dm.4445)[2] + 1.96*dse.4445[2])))
lines(c(3.2,3.2), c((coef(dm.4647)[2] - 1.96*dse.4647[2]), (coef(dm.4647)[2] + 1.96*dse.4647[2])))
lines(c(4.2,4.2), c((coef(dm.4849)[2] - 1.96*dse.4849[2]), (coef(dm.4849)[2] + 1.96*dse.4849[2])))
lines(c(5.2,5.2), c((coef(dm.5051)[2] - 1.96*dse.5051[2]), (coef(dm.5051)[2] + 1.96*dse.5051[2])))

points(1.2:5.2, c(coef(dm.4243)[2], coef(dm.4445)[2],coef( dm.4647)[2], coef(dm.4849)[2],coef(dm.5051)[2]), pch = 15)
legend(1.1, -.05, pch = c(16, 15), c("Support ACA", "Don't Cut Medicare"), cex = .75, box.col = "white")

axis(2, seq(-.1, .1, .05), seq(-.1, .1, .05), tick = F, las=2, cex.axis=.75)

text(1.1:5.1, rep(.08, 5), c("1942-43 vs. 1944-45", "1944-45 vs. 1946-47", "1946-47 vs. 1948-49", "1948-49 vs. 1950-51", "1950-51 vs. 1951-52"), cex = .6)

dev.off()



####################################
## Figure 7
###################################


pdf("jopfig7.pdf",  width=7,height=5)
par(mar = c(3, 4, 4, 2))
plot(1:4, -1*c(.0480, -.0188,  -.00513,  -.00783),
    ylim=c(-.14,.1), cex.main = .8, pch =16,
     cex.lab = .75, cex.axis=.75, yaxt="n", xaxt="n", ylab = "Public vs. Private Insurance Coefficient", 
     xlab = "",
     main = "Effects of Insurance on Support for Alternative Dependent Variables",xlim = c(.5, 4.5))

se.border <-  .0296
se.birth <-     .0255
se.samesex <- .0252 
se.keystone <-   .02886 

abline(h=seq(-.1, .1, .05), lty=20, col= "gray")
abline(h=0, col = "black")

lines(c(1,1), c(-1*(.0480 - 1.96*se.border), -1*(.0480 + 1.96*se.border)))
lines(c(2,2), c(-1*(-.0188 - 1.96*se.birth), -1*(-.0188 + 1.96*se.birth)))
lines(c(3,3), c(-1*(-.00513 - 1.96*se.samesex), -1*(-.00513 + 1.96*se.samesex)))
lines(c(4,4), c(-1*(-.00783 - 1.96*se.keystone), -1*(-.00783 + 1.96*se.keystone)))

text(1:4, rep(.08, 4), c("Border Controls", "Birth Control Exemption", "Same-Sex Marriage", "Keystone Pipeline"), cex = .6)
axis(2, seq(-.1, .1, .05), seq(-.1, .1, .05), tick = F, las=2, cex.axis=.75)

dev.off()






################################################
## Online Appendix Results
################################################

## Retirement by birth year
byrs <- paste("byr", seq(36, 94, 2), seq(37, 95, 2), sep = "")
yrs <- seq(1936, 1994, 2)
yrs2 <- seq(1937, 1995, 2)

mpub <- rep(NA, length(yrs))
mret <- rep(NA, length(yrs))
for(i in 1:length(yrs2)){
  mpub[i] <-  weighted.mean(cces$pubhealthins3[cces$birthyr == yrs[i] | 
                                                 cces$birthyr == yrs2[i]], 
                            cces$V103[cces$birthyr == yrs[i] | 
                                        cces$birthyr == yrs2[i]], na.rm = T)
  mret[i] <- weighted.mean(cces$retired[cces$birthyr == yrs[i] | 
                                           cces$birthyr == yrs2[i]], 
                            cces$V103[cces$birthyr == yrs[i] | 
                                        cces$birthyr == yrs2[i]], na.rm = T)
}
names(mpub) <- paste(yrs, "-", yrs2, sep = "")
names(mret) <- paste(yrs, "-", yrs2, sep = "")


par(mar = c(7, 4, 4, 2))
plot(1:length(mpub), mpub,
     pch = 16, type = "b",
     ylim = c(0, 1),
     main= "Percent of Respondents Retire vs. Report Public Insurance by Birth Year",
     xaxt = "n", yaxt = "n",
     xlab = "Birth Year",
     ylab = "Percent of Respondents",
     cex.main = .75, cex.lab = .8, cex.axis = .8)
axis(2, seq(0, .9, .3), seq(0, 90, 30), las = 2, cex.axis = .6, tick = FALSE)
polygon(c(6,6, 7, 7, 6), c(0,1, 1, 0, 0), col = "light gray", border = "gray")
abline(h = seq(0, .9, .3), lty = 20, col = "gray")
abline(v = seq(1,length(mpub),1), lty = 20, col = "gray")
axis(1, 1:length(mpub), labels = names(mpub), cex.axis = .5, tick = FALSE, las = 2 )
points(1:length(mpub), mpub,
       pch = 16, type = "b")
points(1:length(mpub), mret, pch = 17, type = "b", col = "dark red")
legend(22, .85, legend = c("Percent Retired", "Percent with Public Insurance"), pch = c(17, 16), col = c("dark red", "black"), cex = .6, box.col = "white")





## Alternative IVs and treatment of employment, (See Stata Code for Regressions)

## Support ACA
org <- -0.0459	
emp <- -0.101
ret <-	-0.0387	
iret <-	0.157
isoc <-	0.0368

org.se <- 0.0228	
emp.se <- 0.0485
ret.se <-0.0253			
iret.se <- 0.0665	
isoc.se <- 0.0152

## Don't Cut Medicare
orgd <- -0.0836
empd <-	-0.156
retd <- -0.0430			
iretd <- 0.248
isocd <- 0.0569

orgd.se <- 0.0269
empd.se <- 0.0542
retd.se <- 0.0309
iretd.se <- 0.0820					
isocd.se <- 0.0181


robc <- cbind(orgd,
              empd,
              retd,
              -1*iretd,
              -1*isocd,
              org,
              emp,
              ret,
              -1*iret,
              -1*isoc)

robc.se <- cbind(orgd.se,
                 empd.se,
                 retd.se,
                 iretd.se,
                 isocd.se,
                 org.se,
                 emp.se,
                 ret.se,
                 iret.se,
                 isoc.se)


par(mar = c(4, 4, 4, 2))
plot(-1*robc, 1:10,
     xlim = c(-.7, .4),
     cex.main = .85, cex.lab = .75, cex.axis = .75,
     ylab = "", xlab = "Coefficient",
     xaxt = "n", yaxt = "n", bty = "n",
     main = "Alternative Specifications: Primary Coefficient Results",
     pch = 20)

abline(h = seq(1, 10, 1), lty = 20, col = "light gray")
abline(v = seq(-.3, .4, .1), col = "light gray", lty = 20)
abline(h = seq(.5, 10.5, 5))
abline(v=0)	
for(i in 1:10){
  
  lines(c(-1*robc[i] - 1.96* robc.se[i], -1*robc[i] + 1.96* robc.se[i]), c(i, i))
  
}	
text(rep(-.45, 20), 1:10, rep(c("Original", "Employed Only", "Retired Only", "Instrument for Retired", "Instrument for Social Category"), 4), cex = .5)

text(-.6 , seq(3.5, 8.5, 5), c("Don't Cut Medicare",  "Support ACA"), cex = .8)

points(-1*robc, 1:10, pch = 20)
axis(1, seq(-.2, .6, .1), round(seq(-.2, .6, .1), digits = 1), tick = F, cex.axis = .8)




## Online Appendix 

## IV Knowledge by party and subgroup

coefkps <- c(-0.0149,	0.245,	0.0123,	-0.0637,	0.0730,	0.0644,	0.00786,	0.120)
sekps <- c(0.0311,0.111, 0.0201, 0.0744, 0.0268, 0.0929, 0.0441,0.105)

coefkps3 <- c(-0.0246,	0.0778,	0.287,	0.00293,	0.0781,	-0.254,	0.0154,	0.165,	0.195,	-0.0186,	0.134,	0.0534)
sekps3 <- c(0.0302,	0.0849,	0.149,	0.0194,	0.0547,	0.134,	0.0248,	0.0783,	0.121,	0.0443,	0.0965,	0.164)


par(mar = c(2, 6, 4, 2))
plot(1:8, coefkps, 
     ylim = c(-.6, .6),
     main = "Effect of Insurance Type on Support for ACA and Medicare by Knowledge and Party \n Public vs. Private Insurance",
     cex.main = .75, cex.lab = .75, cex.axis = .8,
     ylab = "Estimated Percentage Difference in Support \n Public vs. Private Insurance", pch = 16,
     xlab = "", xaxt = "n", yaxt = "n", xlim = c(.9, 8.2))	
for(i in 1:8){
  lines(c(i, i), c(coefkps[i] + 1.96*sekps[i],coefkps[i] - 1.96*sekps[i] ))
  
}	
abline(v=4.5, col = "gray", lty = 20)
text(2.5, .5, "Support for the ACA", cex = .7)
text(6.5, .5, "Don't Cut Medicare", cex = .7)
abline(h = seq(-.6, .6, .20), lty = 20, col = "gray")
axis(2, seq(-.6, .6, .20), c("-60%", "-40%", "-20%", "0%", "20%", "40%", "60%"), tick = F, las = 1, cex.axis = .7)
abline(h=0, col = "black")
text(c(1.5, 5.5), -.48, "Republicans", cex = .8)	
text(c(3.5, 7.5), -.48, "Democrats", cex = .8)	
text(1:8, -.35, rep(c("High \n Knowledge", "Low \n Knowledge"), 4), cex = .65)



par(mar = c(2, 6, 4, 2))
plot(1:12, coefkps3, 
     ylim = c(-.8, .8),
     main = "Effect of Insurance Type on Support for ACA and Medicare by Knowledge and Party \n Public vs. Private Insurance",
     cex.main = .75, cex.lab = .6, cex.axis = .8,
     ylab = "Estimated Percentage Difference in Support \n Public vs. Private Insurance", pch = 16,
     xlab = "", xaxt = "n", yaxt = "n", xlim = c(.9, 12.2))	
for(i in 1:12){
  lines(c(i, i), c(coefkps3[i] + 1.96*sekps3[i],coefkps3[i] - 1.96*sekps3[i] ))
  
}	
abline(v=6.5, col = "gray", lty = 20)
text(3.5, .64, "Support for the ACA", cex = .7)
text(9.5, .64, "Don't Cut Medicare", cex = .7)
abline(h = seq(-.8, .8, .20), lty = 20, col = "gray")
axis(2, seq(-.8, .8, .20), c("-80%", "-60%", "-40%", "-20%", "0%", "20%", "40%", "60%", "80%"), tick = F, las = 1, cex.axis = .7)
abline(h=0, col = "black")
text(c(2, 8), -.68, "Republicans", cex = .8)	
text(c(5, 11), -.68, "Democrats", cex = .8)	
text(1:12, -.55, rep(c("High \n Knowledge", "Medium \n Knowledge", "Low \n Knowledge"), 4), cex = .55)





